package cn.hongwei.factorybean;

import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

/**
 * @author Great
 * @email 1224028994@qq.com
 */
//@Component
public class MyFactoryBean implements FactoryBean<UserDao> {
    @Override
    public UserDao getObject() throws Exception {
        return new UserDao();//往容器中存入的bean对象
    }

    @Override
    public Class<?> getObjectType() {
        return UserDao.class;
    }

    //不重写也可以,默认是单利的
    @Override
    public boolean isSingleton() {
        return true;
    }
}
